﻿<%@ WebHandler Language="C#" Class="DELIVERYGPS" %>

using System;
using System.Web;

public class DELIVERYGPS : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        string domainId, truck_code, datetime;
        if (!string.IsNullOrEmpty(context.Request.Params["domainId"]) && !string.IsNullOrEmpty(context.Request.Params["truck_code"]) && !string.IsNullOrEmpty(context.Request.Params["datetime"]))
        {
            domainId = context.Request.Params["domainId"].ToString().Trim();
            truck_code = context.Request.Params["truck_code"].ToString().Trim();
            datetime = context.Request.Params["datetime"].ToString().Trim();

            string result = "";
            Jumpton.Persistent.ObjectTable ot = new Jumpton.SFA.Server.BusinessRule.Traffic.TrafficManager().GetDeliveryGPS("15", "沪A8823", datetime);
            foreach (Jumpton.SFA.Server.Entity.DELIVERY_GPS gps in ot)
            {
                result += gps.LONGITUDE + "," + gps.LATITUDE + "|";
            }
            if (result.EndsWith("|"))
                result = result.Substring(0, result.Length - 1);
            context.Response.ContentType = "text/plain";
            context.Response.Write(result);
        }
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}